package sg.com.techstudio.ecc.obj;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name="session" )
public class SessionObj implements Serializable {

	private static final long serialVersionUID = 5750420439953415895L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	private int type, no, capacity, hasChild;
	private String name,venue;
	@Column(columnDefinition="TEXT")
	private String description;
	@ManyToMany(cascade= {CascadeType.ALL}, fetch=FetchType.EAGER)
	private List<SpeakerObj> speakers;
	private Long parentSessionId;
	
	public String getTypeStr() {
		switch(type) {
		case 1: return "A";
		case 2: return "B";
		case 3: return "C";
		case 4: return "D";
		}
		return "";
	}
	public int getHasChild() {
		return hasChild;
	}
	public void setHasChild(int hasChild) {
		this.hasChild = hasChild;
	}
	public Long getParentSessionId() {
		return parentSessionId;
	}
	public void setParentSessionId(Long parentSessionId) {
		this.parentSessionId = parentSessionId;
	}
	public List<SpeakerObj> getSpeakers() {
		return speakers;
	}
	public void setSpeakers(List<SpeakerObj> speakers) {
		this.speakers = speakers;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public int getNo() {
		return no;
	}
	public void setNo(int no) {
		this.no = no;
	}
	public int getCapacity() {
		return capacity;
	}
	public void setCapacity(int capacity) {
		this.capacity = capacity;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getVenue() {
		return venue;
	}
	public void setVenue(String venue) {
		this.venue = venue;
	}
	
}
